﻿using System;
using System.Threading.Tasks;

namespace vBridge.Design.Mvvm.Command
{
    public class RelayCommandAsync<TParameter> : RelayCommand<TParameter>
    {
        public RelayCommandAsync(Action<TParameter> action)
            : base(action)
        {
        }

        public RelayCommandAsync(Action<TParameter> action, Predicate<TParameter> predicate)
            : base(action, predicate)
        {
        }

        public override void Execute(Object parameter)
        {
            Task.Run(() => base.Execute(parameter));
        }
    }
}